import React, { Component } from 'react';
import context from '../uilt/context';
class MyHeader extends Component {
  constructor(props){
    super(props)
    this.state={      
            reachlist:[]
    }
  }
    componentDidMount(){
        context.addListener("cate",(list)=>{
            // console.log(list,">>>");
            this.setState({
                catelist:list
            })
        },()=>{
            console.log(this.state.reachlist,"<<<");
        })
        
    }
    fliter(){
        return this.state.reachlist.map((item,index)=>{
            return item.brand
        })
    }
    render() {
        return (
            <div className='myheader'>
                <input type="text"  placeholder='搜索商品'/><span>搜索</span>
                
            </div>
        );
    }
}

export default MyHeader;